<?php $this->pageHeader('Arrangementer'); ?>

<?php echo $this->flashMessage()->renderMessages(); ?>

<div class="header_wrapper">
    <h1>Arrangementer</h1>
    <?php echo $this->filterForm; ?>
</div>

<table class="admin_events">
    <thead>
        <tr>
            <th>Navn</th>
            <th>Sted</th>
            <th>Starttidspunkt</th>
            <th>Sluttidspunkt</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
<?php
    $rowHighlight = false;
    foreach($this->events as $event) {
        $from_date = new RedCross_Date($event['from_date']);
        $to_date= new RedCross_Date($event['to_date']);

        //echo '<tr' . $this->cycle(array('', ' class="highlight"'))->next() . '>';
        //<td>{$from_date->getDateTimeStr()} - {$to_date->getDateTimeStr()}</td>
echo <<<END
        <tr>
            <td><a href="{$this->url(array('module' => 'admin', 'controller' => 'event', 'action' => 'view', 'id' => $event['id']), null, true)}">{$event['name']}</a></td>
            <td>{$event['location']}</td>
            <td>{$from_date->getDateTimeStr()}</td>
            <td>{$to_date->getDateTimeStr()}</td>
            <td>
                <a href="{$this->url(array('module' => 'admin', 'controller' => 'event', 'action' => 'view', 'id' => $event['id']), null, true)}"><img src="{$this->imageLink('/images/icons/event_go.png')}" alt="Vis arrangement: {$event['name']}" title="Vis Arrangement" /></a>
                <a href="{$this->url(array('module' => 'admin', 'controller' => 'event', 'action' => 'edit', 'id' => $event['id']), null, true)}"><img src="{$this->imageLink('/images/icons/event_edit.png')}" alt="Rediger: {$event['name']}" title="Rediger" /></a>
            </td>
        </tr>
END;
    }
?>
    </tbody>
</table>
<?php echo $this->paginationLinks; ?>
